package com.zqu.controller;

import com.zqu.pojo.ByStagesType;
import com.zqu.service.ByStagesTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("bystagestype")
public class ByStagesTypeController {
    @Autowired
    private ByStagesTypeService byStagesTypeService;

    @RequestMapping("findbystagestype")
    @ResponseBody
    public ByStagesType selectById(){
        return byStagesTypeService.selectByStagesTypeById(1);
    }

    @RequestMapping("selectlist")
    @ResponseBody
    public List<ByStagesType> selectlist(){
        return byStagesTypeService.selectList(new ByStagesType());
    }

    @RequestMapping("insertbystagestype")
    @ResponseBody
    public boolean insert(){
        return byStagesTypeService.insertByStagesType(new ByStagesType());
    }

    @RequestMapping("updatebystagestype")
    @ResponseBody
    public boolean update(){
        return byStagesTypeService.updateByStagesType(new ByStagesType());
    }

    @RequestMapping("deletebystagestype")
    @ResponseBody
    public boolean delete(){
        return byStagesTypeService.deleteByStagesType(1);
    }

    @RequestMapping("deletebystagestypebyids")
    @ResponseBody
    public boolean deletebyids(){
        String[] ids = {"1","2"};
        return byStagesTypeService.deleteByStagesTypeByIds(ids);
    }
}
